package cn.skyquant.quant4j.service.boot.model.forex;

import cn.skyquant.quant4j.api.enums.BorkerType;
import cn.skyquant.quant4j.api.enums.ForexConfigType;
import org.springframework.data.domain.Sort;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface ForexConfigRepository extends CrudRepository<ForexConfig, Integer> {

    Sort sort_by_id = new Sort(Sort.Direction.DESC, "id");
    List<ForexConfig> findByTypeAndBorkerType(ForexConfigType type, BorkerType borkerType, Sort sort);
    Optional<ForexConfig> findByNameAndTypeAndBorkerType(String name, ForexConfigType type, BorkerType borkerType);
}
